<?php 

namespace App\Controller;
use Common\Controller\AppcommController;
	header("Content-type: text/html; charset=utf-8"); 

class IndexController extends AppcommController{
	function _initialize() {

		if(!session('?mycity'))
		{
			session('mycity','成都');
		}
		if(!session('?ci'))
		{
			session('ci','1');
		}
	}
	public function index(){
		$keysearchlog = cookie('keysearchlog');
		$this->assign ( "keysearchlog", $keysearchlog );
		// $m = M ( "Flash" );
		// $flashlist =$m->select();
		// $this->assign ( "flashlist", $flashlist );
		$carModel = D('Common/Cars');
		$result = $carModel->car_list(0,6,session('mycity'),'d','','','','','','','','','','','','','','','','',session('ci'));
		$recommend = $result["Data"];
		$this->assign ( "recommend", $recommend );
		$this->display ();
	}

	/**
	*选择城市
	*/
	function  listcity()
	{
		$m = M ( "Market" );
		$citys =$m->distinct(true)->field('mkc')->select();
		$mks =$m->distinct(true)->field('mkname')->select();
		$this->assign ( "citys", $citys );
		$this->assign ( "mks", $mks );
		$this->display ();
	}
	/**
	*关于我们
	*/
	function company()
	{
		$this->display ();	
	}
	/**
	*下载app
	*/
	function appqr()
	{
		$this->display ();	
	}

}